package com.yy.controller;

import com.yy.clientEntities.Payment;
import com.yy.service.TestFeignService;
import com.yy.utils.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author young
 * @date 2022/12/24 16:40
 * @description:
 */
@RestController
@Slf4j
@RequestMapping("/feign")
public class OrderFeinController {
    @Resource
    private TestFeignService testFeignService;
    
    @GetMapping("/getService/{id}")
    public Result<Payment> getOne(@PathVariable("id")Integer id){
        return testFeignService.getOne(id);
    }
    
    @GetMapping("/timeout")
    public String feignTimeout(){
        return testFeignService.timeout();
    }
}
